package cn.turboinfo.dongying.api.entity.common.enumeration.common;

import lombok.extern.slf4j.Slf4j;
import net.sunshow.toolkit.core.base.enums.BaseEnum;
import net.sunshow.toolkit.core.base.enums.BaseEnumHelper;

import java.util.List;

/**
 * 内部实体对象类型
 */
@Slf4j
public enum EntityObjectType implements BaseEnum {

    ALL(-1, "全部"),

    DEFAULT(0, "默认"),

    CATEGORY(20, "分类"),

    SHOP(40, "店铺"),

    COMMUNITY(60, "社区"),

    DIVISION(100, "地区");

    private int value;
    private String name;

    EntityObjectType(int value, String name) {
        this.value = value;
        this.name = name;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public String toString() {
        return name;
    }

    public static EntityObjectType get(int value) {
        return BaseEnumHelper.getByValue(value, values());
    }

    public static List<EntityObjectType> list() {
        return BaseEnumHelper.getList(values());
    }

    public static List<EntityObjectType> listAll() {
        return BaseEnumHelper.getAllList(values());
    }
}
